{% if blogs %}
    {% for blog in blogs %}
        <div class="card mb-4">
            <div class="card-header">
                <a href="{% url 'blog:blog_detail' blog_id=blog.id %}">{{ blog.title }}</a>
            </div>
            <div class="card-body" style="height: 150px;overflow: hidden">
                <p class="card-text">{{ blog.content|striptags | truncatechars:885 }}</p>
            </div>
            <div class="card-footer text-muted" style="height: 40px;display: flex;justify-content: space-between;align-items: center">
                <div>
                    <img src="{% static 'image/头像.jpg' %}" alt="" height=30px class="rounded-circle">
                    <span>{{ blog.author.username }}</span>
                </div>
                <div>
                    发布时间：{{ blog.pub_time|date:'Y年m月d日 H:i:s' }}
                </div>
            </div>
        </div>
    {% endfor %}
{% else %}
    <div class="text-center" style="height: 700px;">
        <img src="{% static 'image/暂无内容.webp' %}" alt="">
    <p class="text-secondary">暂无相关内容</p>
    </div>
{% endif %}